package com.hsgene.product.service.api;

import com.hsgene.common.util.result.ApiResult;
import com.hsgene.common.util.result.NullObject;
import com.hsgene.product.service.api.impl.SampleServiceImpl;
import com.hsgene.sample.dto.GeneticTestingSampleDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @desc:样本管理
 * @author: fuxiang
 * @date: 2018/8/14 14:24
 */
@FeignClient(value = "ms-mod-sample", path = "/v1.0/genetic/testing/sample", fallback = SampleServiceImpl.class)
public interface SampleService {
    /**
     * 将样本标记为已使用过
     *
     * @param
     * @return
     */
    @PutMapping("used")
    ApiResult<NullObject> updateSampleUsed(@RequestParam("sampleId") String sampleId);


    /**
     * 根据ids获取样本
     *
     * @return
     */
    @GetMapping("sampleList")
    ApiResult<List<GeneticTestingSampleDto>> getSamplesByids(@RequestParam("ids") String ids);

    /**
     * 更新样本呗使用的数量
     *
     * @param id
     * @param type add或reduce
     * @return
     */
    @PutMapping("used/amount")
    ApiResult updateIsUsedAmount(@RequestParam("id") String id, @RequestParam("type") String type);
}
